#include "pt.h"
#include "pt_vad.h"
#include "pt_pcm_utils.h"

// 需要是绝对路径，否则需要放在build完的可执行文件路径下面
#define PCM_INPUT_PATH   "D:/Project/0000/ctest/demo/audio/resource/VAD_04.pcm"
#define VAD_OUTPUT_PATH   "D:/Project/0000/ctest/demo/audio/resource/output04.pcm"

int main()
{
    int pcm_size = 0;
    uint8_t *pcm = NULL;

    pcm_size = pt_read_pcm(PCM_INPUT_PATH, &pcm);
    if(!pcm)
    {
        PT_LOGE("pcm null\n");
        return 1;
    }

    // PT_LOGD("%d %02X %02X\n", pcm_size, pcm[0], pcm[1]);

    // your code
    pt_vad_test(pcm, pcm_size);

    pt_save_pcm(VAD_OUTPUT_PATH, pcm, pcm_size);

    if(pcm)
        free(pcm);

    return 0;
}
